﻿using Coldairarrow.Entity.PB;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Coldairarrow.Entity.TD
{
    public partial class TD_OutStorRecord
    {
        [ForeignKey(nameof(OutStorId))]
        public TD_OutStorage InStorage { get; set; }

        [ForeignKey(nameof(MaterialId))]
        public PB_Material Material { get; set; }
    }
    public class TD_OutStorRecordEntityTypeConfig : IEntityTypeConfiguration<TD_OutStorRecord>
    {
        public void Configure(EntityTypeBuilder<TD_OutStorRecord> builder)
        {
            builder.HasQueryFilter(w => w.Deleted == false);
        }
    }
}
